home *** CD-ROM | disk | FTP | other *** search
- unit z_demo;
-
- interface
-
- uses
- z_prof,Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Button2: TButton;
- fsin: TButton;
- fmul: TButton;
- fdiv: TButton;
- fadd: TButton;
- Label1: TLabel;
- procedure FormCreate(Sender: TObject);
- procedure faddClick(Sender: TObject);
- private
- { Private declarations }
- public
- mprof:tzprofiler;
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
- const aa:extended=0;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- mprof:= tzprofiler.create(self);
- end;
-
- procedure TForm1.faddClick(Sender: TObject);
- var tt:dword;
- begin
- with profile , tcontrol(sender) do
- case tag of
- 1: begin mark(tag,true);sleep(100);mark(tag,false);end;
- 2: begin mark(tag,true);
- tt:=gettickcount;while tt= gettickcount do;
- while gettickcount<(tt+101) do;
- mark(tag,false);end;
- 3: begin mark(tag,true);aa:=3.14+3.14;mark(tag,false);end;
- 4: begin mark(tag,true);aa:=3.14*3.14;mark(tag,false);end;
- 5: begin mark(tag,true);aa:=3.14/3.14;mark(tag,false);end;
- 6: begin mark(tag,true);aa:=sin(3.14);mark(tag,false);end;
- end;
- end;
-
- end.
-